package com.mrart.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mrart.entity.User;
import com.mrart.mysql.mapper.UserMapper;
import com.mrart.service.UserService;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;
    
    /* (non-Javadoc)
     * @see com.mrart.service.impl.UserService#findByUsername(java.lang.String)
     */
    @Override
    public User findByUsername(String username) {
        List<User> users = userMapper.findByUsername(username);
        if(users!=null && users.size()>0) {
            return users.get(0);
        } else {
            return null;
        }
    }
}
